package com.zhijian.medical.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 全局状态枚举类
 *
 * @author HCG
 * @version 1.0
 * @date 2022/8/16
 */
@AllArgsConstructor
@Getter
public enum EmailSendStatusEnum {

    UN_SEND(0, "未发送"),
    ALREADY_SEND(1, "已发送");

    private Integer code;
    private String desc;

    public static EmailSendStatusEnum getByCode(Integer code) {
        EmailSendStatusEnum[] values = EmailSendStatusEnum.values();
        for (EmailSendStatusEnum anEnum : values) {
            if (anEnum.getCode().equals(code)) {
                return anEnum;
            }
        }
        return null;
    }
}
